<?php

class Model_Portfolio extends Zend_Db_Table_Abstract {

    protected $_name = 'portfolio';

    public function fetchPortfolio($where = "", $limit = "", $offset = "0") {
	$select = $this->select()
			->where("active = '1'")
			->order('sortorder ASC');
	if ($limit != "") {
	    $select->limit($limit, $offset);
	}
	return $this->fetchAll($select);
    }

    public function getPortfolioCount() {
	$select = $this->select();
	$select->from($this, array('count(id) as amount'))
		->where("active = '1'");
	$rows = $this->fetchAll($select);
	return($rows[0]->amount);
    }

}

?>